/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ADMIN
 */
@Entity
@Table(name = "departamento", catalog = "SIESCO", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Departamento.findAll", query = "SELECT d FROM Departamento d"),
    @NamedQuery(name = "Departamento.findByIddepto", query = "SELECT d FROM Departamento d WHERE d.iddepto = :iddepto"),
    @NamedQuery(name = "Departamento.findByIdzona", query = "SELECT d FROM Departamento d WHERE d.idzona = :idzona"),
    @NamedQuery(name = "Departamento.findByNombredepatamento", query = "SELECT d FROM Departamento d WHERE d.nombredepatamento = :nombredepatamento")})
public class Departamento implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "iddepto", nullable = false)
    private Integer iddepto;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idzona", nullable = false)
    private int idzona;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 60)
    @Column(name = "nombredepatamento", nullable = false, length = 60)
    private String nombredepatamento;

    public Departamento() {
    }

    public Departamento(Integer iddepto) {
        this.iddepto = iddepto;
    }

    public Departamento(Integer iddepto, int idzona, String nombredepatamento) {
        this.iddepto = iddepto;
        this.idzona = idzona;
        this.nombredepatamento = nombredepatamento;
    }

    public Integer getIddepto() {
        return iddepto;
    }

    public void setIddepto(Integer iddepto) {
        this.iddepto = iddepto;
    }

    public int getIdzona() {
        return idzona;
    }

    public void setIdzona(int idzona) {
        this.idzona = idzona;
    }

    public String getNombredepatamento() {
        return nombredepatamento;
    }

    public void setNombredepatamento(String nombredepatamento) {
        this.nombredepatamento = nombredepatamento;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iddepto != null ? iddepto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Departamento)) {
            return false;
        }
        Departamento other = (Departamento) object;
        if ((this.iddepto == null && other.iddepto != null) || (this.iddepto != null && !this.iddepto.equals(other.iddepto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Departamento[ iddepto=" + iddepto + " ]";
    }
    
}
